<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
	<head>
		<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
		<title>Application Scopes &mdash; Intype Documentation</title>
		<link rel="stylesheet" href="css/static.css" type="text/css" />
		<link rel="stylesheet" href="css/content.css" type="text/css" />
	</head>
	<body>
		<div id="page"><div id="page-inner">

			<div id="sub-header"><div id="sub-header-inner">
				&nbsp;
			</div></div>

			<div id="cols">

				<div id="nav">
					<div id="nav-inner">
						<h1>Manual</h1>
						<ul>
							<li><a href="introduction.html" class="title"><span>Introduction</span></a></li>
							<li><a href="editing.html" class="title"><span>Editing</span></a>
							<ul>
								<li><a href="selections.html" class="title"><span>Selections</span></a></li>
								<li><a href="find_and_replace.html" class="title"><span>Find & Replace</span></a></li>
							</ul>
							</li>
							<li><a href="preferences.html" class="title"><span>Preferences</span></a>
							<ul>
								<li><a href="appearance_preferences.html" class="title"><span>Appearance Preferences</span></a></li>
							</ul>
							</li>
							
							<li><a href="scopes.html" class="title"><span>Scopes</span></a>
							<ul>
								<li><a href="document_scopes.html" class="title"><span>Document Scopes</span></a></li>
								<li><a href="application_scopes.html" class="title"><span>Application Scopes</span></a></li>
								<li><a href="scope_selectors.html" class="title"><span>Scopes Selectors</span></a></li>
								<li><a href="scope_naming_conventions.html" class="title"><span>Naming Conventions</span></a></li>
							</ul>
							</li>
							
							<li><a href="bundles.html" class="title"><span>Bundles</span></a>
							<ul>
								<li><a href="bundle_items.html" class="title"><span>Bundle Items</span></a></li>
								<li><a href="scopes.html" class="title"><span>Scopes</span></a></li>
								<li><a href="snippets.html" class="title"><span>Snippets</span></a></li>
								<li><a href="languages.html" class="title"><span>Languages</span></a></li>
								<li><a href="built_in_bundles.html" class="title"><span>Built-In Bundles</span></a></li>
							</ul>
							</li>
							<li><span class="title missing"><span>appendix</span></span>
							<ul>
								<li><a href="jasmine.html" class="title"><span>Jasmine</span></a></li>
								<li><a href="regular_expressions.html" class="title"><span>Regular Expressions</span></a></li>
							</ul>
							</li>
						</ul>
					</div>
				</div>

				<div id="content">
					<div id="content-right">
						<div id="content-left">
							<div id="content-inner">
								<h1>Application Scopes</h1>

<p>Intype is also using scopes (like <a href="document_scopes.html">document scopes</a>) for widgets (and their internal states) in user interface. These application scopes are used internally for all commands (or if you want, events), but also can be used by your custom commands. This scheme then allows you to override or extend any default behavior.</p>

<p>(TODO)</p>

<h2>Document Scope Naming Conventions</h2>

<p>Because Intype uses similar language system as all-mighty TextMate does, it also follows its <a href="http://macromates.com/textmate/manual/language_grammars#naming_conventions">naming conventions</a>. </p>

<p>The reason for making such conventions, is the universality of the bundle items and themes. A theme defining styles for these 11 elements would cover most languages, and therefore should not be optimized for different ones. Also the snippets, commands, or paired characters can be then scoped accross the languages.</p>

<p>Following list shows basic 11 elements and their classes. Alhought displayed as a tree, the final scope would be a dot-joined string, like these:</p>

<pre><code>comment.line.double-slash       // Double slashed comment
string.quoted.double            "Double-Quoted String"
markup.underline.line           http://intype.info/
</code></pre>

<table class="w">
    <thead>
        <th>Element &bull; Class</th>
        <th>Description</th>
        <th>Example</th>
    </thead>

    <tr><th class="li-0 t"><span><code>comment</code></p></span></th><th colspan="2">Line or block comments</p></td></tr>
<tr><td class="li-1 t"><span><code>line</code></p></span></td><td colspan="2">Single line comment</p></td></tr>
<tr><td class="li-2 t"><span><code>double-slash</code></p></span></td><td>&nbsp;</td><td><code>// Commented text</code></p></td></tr>
<tr><td class="li-2 t"><span><code>double-dash</code></p></span></td><td>&nbsp;</td><td><code>-- Commented text</code></p></td></tr>
<tr><td class="li-2 t"><span><code>number-sign</code></p></span></td><td>&nbsp;</td><td><code># Commented text</code></p></td></tr>
<tr><td class="li-2 t"><span><code>percentage</code></p></span></td><td>&nbsp;</td><td><code>% Commented text</code></p></td></tr>
<tr><td colspan="3">You can specify different single-line comments, if you do so, use <a href="http://www.unicode.org/charts/PDF/U0000.pdf">Unicode</a> conventions for naming your class.</p></td></tr>
<tr><th class="li-0 t"><span><code>constant</code></p></span></th><th colspan="2">Constants</p></td></tr>
<tr><td class="li-1 t"><span><code>numeric</code></p></span></td><td>Constant representing numbers.</p></td><td><code>82</code> &bull; <code>1.618f</code> &bull; <code>0x26A</code></p></td></tr>
<tr><td class="li-1 t"><span><code>character</code></p></span></td><td>Constants representing characters.</p></td><td><code>&amp;lt;</code> &bull; <code>\n</code> &bull; <code>\031</code></p></td></tr>
<tr><td class="li-1 t"><span><code>language</code></p></span></td><td>Language-specific constants.</p></td><td><code>true</code> &bull; <code>false</code> &bull; <code>nil</code></p></td></tr>
<tr><td class="li-1 t"><span><code>other</code></p></span></td><td>Other constants, like CSS values.</p></td><td><code>blue</code> &bull; <code>left</code> &bull; <code>bold</code></p></td></tr>
<tr><th class="li-0 t"><span><code>entity</code></p></span></th><th colspan="2">Entities</p></td></tr>
<tr><td colspan="3">Entity is usually an identifier of larger part of the document, for example a class, function, tag or chapater. Use <code>meta</code> element to scope entity's content parts.</p></td></tr>
<tr><td class="li-1 t"><span><code>name</code></p></span></td><td colspan="2">A name of the larger part.</p></td></tr>
<tr><td class="li-2 t"><span><code>function</code></p></span></td><td colspan="2">Name of a function.</p></td></tr>
<tr><td class="li-2 t"><span><code>type</code></p></span></td><td colspan="2">Name of a type.</p></td></tr>
<tr><td class="li-2 t"><span><code>tag</code></p></span></td><td colspan="2">Name of a tag.</p></td></tr>
<tr><td class="li-2 t"><span><code>section</code></p></span></td><td colspan="2">Title of a section.</p></td></tr>
<tr><td class="li-1 t"><span><code>other</code></p></span></td><td colspan="2">Other entities.</p></td></tr>
<tr><td class="li-2 t"><span><code>inherited-class</code></p></span></td><td colspan="2">Name of the superclass/baseclass.</p></td></tr>
<tr><td class="li-2 t"><span><code>attribute-name</code></p></span></td><td colspan="2">Name of the attribute (mainly of a tag).</p></td></tr>
<tr><th class="li-0 t"><span><code>invalid</code></p></span></th><th colspan="2">Invalid parts of the source code</p></td></tr>
<tr><td class="li-1 t"><span><code>illegal</code></p></span></td><td colspan="2">Illegal part of the source code. For example an ampersand, or lower-than sign in HTML (which is not part of an entity/tag).</p></td></tr>
<tr><td class="li-1 t"><span><code>deprecated</code></p></span></td><td colspan="2">Used for scoping deprecated parts of the source code. For example scoping HTML tags and attributes in strict mode.</p></td></tr>
<tr><th class="li-0 t"><span><code>keyword</code></p></span></th><th colspan="2">Keywords (if other elements won't fit)</p></td></tr>
<tr><td class="li-1 t"><span><code>control</code></p></span></td><td>Keywords that control flow.</p></td><td><code>for</code> &bull; <code>if</code> &bull; <code>return</code></p></td></tr>
<tr><td class="li-1 t"><span><code>operator</code></p></span></td><td>Operators</p></td><td><code>or</code> &bull; <code>&amp;&amp;</code> &bull; <code>+</code></p></td></tr>
<tr><td class="li-1 t"><span><code>other</code></p></span></td><td colspan="2">Other keywords</p></td></tr>
<tr><th class="li-0 t"><span><code>markup</code></p></span></th><th colspan="2">Markup</p></td></tr>
<tr><td colspan="3">Intended to use with markup languages (Markdown, Textile, Texy!) to scope larger portions of the text.</p></td></tr>
<tr><td class="li-1 t"><span><code>underline</code></p></span></td><td colspan="2">Underlined text</p></td></tr>
<tr><td class="li-2 t"><span><code>link</code></p></span></td><td colspan="2">Links are derived from <code>markup.underline</code>, so if there's no theme item to highlight links, we can fallback to underline.</p></td></tr>
<tr><td class="li-1 t"><span><code>bold</code></p></span></td><td colspan="2">Bold text, or similar with strong stress.</p></td></tr>
<tr><td class="li-1 t"><span><code>heading</code></p></span></td><td colspan="2">A title of a section. You can, optionally, provide a level in next class like <code>markup.heading.2.html</code> for <code>&lt;h2&gt;</code>&hellip;<code>&lt;/h2&gt;</code></p></td></tr>
<tr><td class="li-1 t"><span><code>italic</code></p></span></td><td colspan="2">Italic text, or similar with emphasize stress.</p></td></tr>
<tr><td class="li-1 t"><span><code>list</code></p></span></td><td colspan="2">List items</p></td></tr>
<tr><td class="li-2 t"><span><code>numbered</code></p></span></td><td colspan="2">Numbered (ordered) list item.</p></td></tr>
<tr><td class="li-2 t"><span><code>unnumbered</code></p></span></td><td colspan="2">Not numbered (unordered) list item.</p></td></tr>
<tr><td class="li-1 t"><span><code>quote</code></p></span></td><td colspan="2">Quoted text.</p></td></tr>
<tr><td class="li-1 t"><span><code>raw</code></p></span></td><td colspan="2">A raw, verbatim text like source code. Some features, like spell-checking can be switched off for <code>markup.raw</code> scope.</p></td></tr>
<tr><td class="li-1 t"><span><code>other</code></p></span></td><td colspan="2">Other markup constructs.</p></td></tr>
<tr><th class="li-0 t"><span><code>meta</code></p></span></th><th colspan="2">Meta</p></td></tr>
<tr><td colspan="3">The meta scope used for scoping larger documents parts. For example part that contains entire function declaration and/or definition would be scoped <code>meta.function</code>.</p></td></tr>
<tr><th class="li-0 t"><span><code>storage</code></p></span></th><th colspan="2">Storage types, modifiers,...</p></td></tr>
<tr><td class="li-1 t"><span><code>type</code></p></span></td><td>Type of something.</p></td><td><code>function</code> &bull; <code>class</code> &bull; <code>int</code></p></td></tr>
<tr><td class="li-1 t"><span><code>modifier</code></p></span></td><td>A storage modifier</p></td><td><code>static</code> &bull; <code>final</code> &bull; <code>abstract</code></p></td></tr>
<tr><th class="li-0 t"><span><code>string</code></p></span></th><th colspan="2">Strings</p></td></tr>
<tr><td class="li-1 t"><span>quoted</p></span></td><td colspan="2">String in various quotes</p></td></tr>
<tr><td class="li-2 t"><span><code>single</code></p></span></td><td>Single quoted string</p></td><td><code>'text...'</code></p></td></tr>
<tr><td class="li-2 t"><span><code>double</code></p></span></td><td>Double quoted string</p></td><td><code>"text..."</code></p></td></tr>
<tr><td class="li-2 t"><span><code>tripple</code></p></span></td><td>Tripple quoted string</p></td><td><code>"""Python..."""</code></p></td></tr>
<tr><td class="li-2 t"><span><code>other</code></p></span></td><td>Other types of quoting.</p></td><td><code>$('shell')</code> &bull; <code>%s{...}</code></p></td></tr>
<tr><th class="li-0 t"><span><code>support</code></p></span></th><th colspan="2">Stuff provided by an external library or a framework.</p></td></tr>
<tr><td class="li-1 t"><span><code>function</code></p></span></td><td>Function or method by the library.</p></td><td><code>render_partial</code> in Ruby on Rails</p></td></tr>
<tr><td class="li-1 t"><span><code>class</code></p></span></td><td>Class provided by the library.</p></td><td><code>Document</code> class from DOM</p></td></tr>
<tr><td class="li-1 t"><span><code>type</code></p></span></td><td>Type provided by the library.</p></td><td><code>typedef</code>s or <code>struct</code>s in C languages</p></td></tr>
<tr><td class="li-1 t"><span><code>constant</code></p></span></td><td colspan="2">Constant provided by the library.</p></td></tr>
<tr><td class="li-1 t"><span><code>variable</code></p></span></td><td colspan="2">Variable provided by the library.</p></td></tr>
<tr><td class="li-1 t"><span><code>other</code></p></span></td><td colspan="2">Other stuff provided by the library.</p></td></tr>
<tr><th class="li-0 t"><span><code>variable</code></p></span></th><th colspan="2">Variable names</p></td></tr>
<tr><td colspan="3">Not all languages allow easy identification and thus matching of the variables.</p></td></tr>
<tr><td class="li-1 t"><span><code>parameter</code></p></span></td><td colspan="2">Variable declared as a parameter to method or function.</p></td></tr>
<tr><td class="li-1 t"><span><code>language</code></p></span></td><td>Variable declared by a language.</p></td><td><code>this</code> &bull; <code>super</code> &bull; <code>self</code></p></td></tr>
<tr><td class="li-1 t"><span><code>other</code></p></span></td><td>Other, usually user declared variables</p></td><td><code>$my_var</code> &bull; <code>var</code>&nbsp;<strong><code>my_var</code></strong></p></td></tr>


</table>
							</div>
						</div>
					</div>
				</div>

			</div>

		</div>

		</div>
	</body>
</html>